/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function loadUsers(inventory, user){
    //$("#usersContent").load('/images/ajax-loader.gif');
    $("#usersContent").html('<img src="/images/ajax-loader.gif">');
    
    /*var userParam = 'iid='&inventory;
    
    if (user){
        userParam = '&cid='+user;
    }*/
    
    var userParam = {iid: inventory, cid: user};
    
    $("#usersContent").load(
        "/Inventory/users", 
        userParam,
        function(){
            $("button").button({
                icons: { secondary: "ui-icon-circle-close" }
            });
        }
    );
    

    
    /*
    $.ajax({
        url: '/Inventory/users',
        data: 'iid=' + inventory + userParam,
        success: function(html){
            $("#usersContent").empty();
            $("#usersContent").append(html);
            
            $("button").button({
                icons: { secondary: "ui-icon-circle-close" }
            });
        },
        error: function(jqXHR, textStatus, errorThrown){
            showInformation(errorThrown);
        }

    });*/
    
}


$(function (){
    $("#adminFm").ajaxForm({
        target: "#inventoryContent",
        });
        
    /*$('#adminFm').submit(function(){
          $(this).ajaxSubmit({target: '#inventoryContent'}) 
          return false;
       });*/    
});